package com.cloud.report.api.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cloud.report.api.entity.ReportDatasource;
import com.cloud.report.api.mapper.ReportDatasourceMapper;
import com.cloud.report.api.service.ReportDataSourceService;
import com.cloud.report.common.dynamic.DynamicDataSource;

@Service
@Transactional
public class ReportDataSourceServiceImpl implements ReportDataSourceService{

	@Autowired
	private ReportDatasourceMapper reportDataSourceMapper;
	
	@Override
	public List<ReportDatasource> listDataSource() {
		return reportDataSourceMapper.selectAll();
	}

	@Override
	public ReportDatasource saveUpdateDataSource(ReportDatasource ds) {
		return null;
	}

	@Override
	public ReportDatasource load(int id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long deleteDataSource(long id) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String tryConnection(ReportDatasource ds) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	@DynamicDataSource
	public void test(String string) {
		reportDataSourceMapper.selectAll();
	}

}
